<%@page import="helpers.UrlHelper"%>
<%@page import="models.ConfigModel"%>
<%@page import="models.LinkModel"%>
<%
	ConfigModel siteConfig = (ConfigModel) request.getAttribute("config");
	LinkModel link = (LinkModel) request.getAttribute("link");
	String image = UrlHelper.getServerUrl(request) + "/blobstore-serve?blob-key=" + siteConfig.getLogo();
%>

<jsp:include page="/layouts/header.jsp">
    <jsp:param name="title" value="<%=siteConfig.getTitle()%>" />
    <jsp:param name="description" value="<%=siteConfig.getMetaDescription()%>" />
    <jsp:param name="keywords" value="<%=siteConfig.getMetaKeywords()%>" />
    <jsp:param name="ogsite_name" value="<%=siteConfig.getSiteName()%>" />
    <jsp:param name="ogtitle" value="<%=siteConfig.getTitle()%>" />
    <jsp:param name="ogurl" value="<%=UrlHelper.getServerUrl(request)%>" />
    <jsp:param name="ogimage" value="<%=image %>" />
    <jsp:param name="ogdescription" value="<%=siteConfig.getMetaDescription()%>" />
</jsp:include>
		
		<h2 class="title">Payment</h2>
		<br />
		<!-- submit form -->
		<div class="submit-form">
			<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
				<table width="100%" cellpadding="0" cellspacing="0">
					<thead>
						<tr>
							<td colspan="2"><div class="title-form">Payment Info</div></td>
						</tr>
					</thead>
					<tbody>
						<tr>
							<td width="30%" class="title">Name: </td>
							<td><%=link.getName() %></td>
						</tr>
						<tr>
							<td class="title">Url: </td>
							<td><%=link.getUrl() %></td>
						</tr>
						<tr>
							<td class="title">Cost: </td>
							<td>$2</td>
						</tr>
						<tr>
							<td class="title">Unit: </td>
							<td>1</td>
						</tr>
						<tr>
							<td colspan="2" align="center">
								<input type="hidden" name="cmd" value="_xclick">  
							 	<input type="hidden" name="business" value="<%=siteConfig.getPaypalAccount()%>">  
							 	<input type="hidden" name="item_name" value="<%=link.getName()%>">  
							 	<input type="hidden" name="item_number" value="<%=link.getId()%>LINK">  
							 	<input type="hidden" name="amount" value="2">  
							 	<input type="hidden" name="quantity" value="1">  
							 	<input type="hidden" name="no_note" value="1">
							 	<input type="hidden" name="currency_code" value="<%=siteConfig.getPaypalCurrency()%>">
							 	<input type="hidden" name="return" value="<%=UrlHelper.getServerUrl(request)%>/message?txt=payment-success">  
							 	<!-- Enable override of buyers’s address stored with PayPal . -->
							 	<input type="hidden" name="address_override" value="1">
								<input type="image" name="submit" border="0" src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" alt="PayPal - The safer, easier way to pay online">
							</td>
						</tr>
					</tbody>
				</table>
			</form>
		</div>
 

<jsp:include page="/layouts/footer.jsp">
    <jsp:param name="language" value="1" />
</jsp:include>